
package com.zsrt.jmj.children.service.impl;

import java.util.List;
import java.util.Map;

import com.zsrt.jmj.children.dao.ChildrenDao;
import com.zsrt.jmj.children.dao.impl.ChildrenDaoImpl;
import com.zsrt.jmj.children.entity.ChildrenEntity;
import com.zsrt.jmj.children.service.ChildrenService;

public class ChildrenServiceImpl implements ChildrenService {

	private ChildrenDao dao= new ChildrenDaoImpl();
	@Override
	public void findAllPositions(Map<String, Object> map) {
		
		try {
			List<ChildrenEntity> positions = dao.findAllPositions();
			map.put("result", "success");
			map.put("jieguo", "查询成功...");
			map.put("data", positions);
		} catch (Exception e) {
			map.put("result", "failure");
			map.put("jieguo", "查询失败...");
			e.printStackTrace();
		}
	}
	@Override
	public void findAllEducations(Map<String, Object> map) {
		try {
			List<ChildrenEntity> positions = dao.findAllEducations();
			map.put("result", "success");
			map.put("jieguo", "查询成功...");
			map.put("data", positions);
		} catch (Exception e) {
			map.put("result", "failure");
			map.put("jieguo", "查询失败...");
			e.printStackTrace();
		}
		
	}
	@Override
	public void findAll(String fatherId, Map<String, Object> map) {
		int fId = Integer.parseInt(fatherId);
		try {
			List<ChildrenEntity> allThings = dao.findAll(fId);
			map.put("result", "success");
			map.put("jieguo", "查询成功...");
			map.put("data", allThings);
		} catch (Exception e) {
			map.put("result", "failure");
			map.put("jieguo", "查询失败...");
			e.printStackTrace();
		}
	}

}
